package com.open.capacity.notice.provider;

import java.io.IOException;
import java.util.Map;
import java.util.function.Consumer;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.plugin.core.Plugin;

import com.open.capacity.notice.provider.core.http.ThOkHttp3Template;
import com.open.capacity.notice.provider.core.http.interactive.req.ThRequest;

public interface NoticeTemplate extends InitializingBean, Plugin<String> {

	public ThOkHttp3Template getThOkHttp3Template();

	default public <T> T getProperties() {
		return null;
	};

	default public <T> T opsForChannel() {
		return null;
	}

	default public <T> T asyncOpsForChannel() {
		return null;
	}

	@Override
	default void afterPropertiesSet() throws Exception {
	}

	default <REQ extends ThRequest> void sendText(REQ request, Consumer<Map<String,Object>> success,
			Consumer<IOException> failure) throws IOException {
	};

}